/*
 * @Author: zqg
 * @Date: 2021-01-13 13:47:26
 * @LastEditors: zqg
 * @LastEditTime: 2021-03-20 17:44:59
 * @Description: 绩效相关API
 */
import request from '@/utils/request'
/**
 * @description: 考核管理分页数据
 * @param {object} 请求参数
 * @param {number} 显示调试
 * @param {number} 当前页数
 * @return {Promise}
 */
export function page(form, pageSize, currentPage) {
  return request.post('/performance/page', {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  })
}
/**
 * @description: 新增绩效规则
 * @param {object} 请求参数
 * @return {Promise}
 */
export function addPerformance(options) {
  return request.post(`/performance/save`, options)
}
/**
 * @description: 修改绩效规则
 * @param {object} 请求参数
 * @return {Promise}
 */
export function updatePerformance(options) {
  return request.put(`/performance/save`, options)
}
/**
 * @description: 绩效启用/禁用
 * @param {Number} id
 * @return {Promise}
 */
export function setPerformanceStatus(id) {
  return request.get(`/performance/status/${id}`)
}
/**
 * @description: 绩效详情
 * @param {Number} id
 * @return {Promise}
 */
export function performanceDetail(id) {
  return request.get(`/performance/${id}`)
}
/**
 * @description: 删除绩效
 * @param {Number} id
 * @return {Promise}
 */
export function performanceDelete(id) {
  return request.delete(`/performance/${id}`)
}
/**
 * @description: 根据规则id获取考核信息
 * @param {Number} 规则id
 * @return {Promise}
 */
export function getRuleDetail(ruleId) {
  return request.get(`/performance/getRulesAssess/${ruleId}`)
}
/**
 * @description:  绩效设置-详情
 * @param {Number} id
 * @return {Promise}
 */
 export function performanceSetDetail(id) {
  return request.get(`/performanceSet/${id}`)
}
/**
 * @description: 绩效设置-列表
 * @param {object} 请求参数
 * @return {Promise}
 */
export function performanceSetPage(options) {
  return request.post(`/performanceSet/page`,options)
}
/**
 * @description: 绩效设置-获取
 * @param {String} 时间
 * @return {Promise}
 */
 export function getPerformanceSet(date) {
  return request.get(`/performanceSet/detail/${date}`)
}
/**
 * @description: 绩效设置-保存
 * @param {object} 请求参数
 * @return {Promise}
 */
export function performanceSetSave(options) {
  return request.post(`/performanceSet/save`, options)
}
/**
 * @description: 绩效设置-更新
 * @param {object} 请求参数
 * @return {Promise}
 */
export function performanceSetUpdate(options) {
  return request.put(`/performanceSet/save`, options)
}
